import request from '@/utils/request'


/**
 * 新增菜单信息
 * @param {Object} data
 */
export function addMenusInfo(data) {
	return request({
		url: `/admin/v1/menu/`,
		method: 'post',
		data
	})
}

/**
 * 修改菜单信息
 * @param {Object} data
 */
export function modifyMenusInfo(data) {
	return request({
		url: `/admin/v1/menu/${data.menuId}`,
		method: 'put',
		data
	})
}

/**
 * 删除指定菜单
 * @param {Object} menuId
 */
export function deleteMenusInfo(menuId) {
	return request({
		url: `/admin/v1/menu/${menuId}`,
		method: 'delete'
	})
}

/**
 * 通过父Id 获取该节点下的菜单信息
 * @param {Object} parentId
 */
export function getMenusByParentId(data) {
	return request({
		url: `/admin/v1/menu/${data.menuId}/${data.page}/${data.size}`,
		method: 'get'
	})
}


/**
 * 获取页面菜单
 */
export function getMenuTree() {
	return request({
		url: '/admin/v1/menu/tree',
		method: 'get'
	})
}


/**
 *搜索页面菜单
 */
export function searchMenu(data) {
	return request({
		url: '/admin/v1/menu/search',
		method: 'post',
		data
	})
}
